package com.unfbx.chatgpt.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class R {
    //前后端数据协议工具类

    private Boolean flag;

    private Object data;

    private String msg;

    private Integer code;
    public R(){}

    public R(Boolean flag){
        this.flag = flag;
    }

    public R(Boolean flag, Object data){
        this.flag = flag;
        this.data = data;
    }
    public R(Boolean flag, String msg, Integer code){
        this.flag = flag;
        this.msg = msg;
        this.code = code;
    }
    public R(Boolean flag, String msg){
        this.flag = flag;
        this.msg = msg;
    }
    public R(String msg){
        this.flag = false;
        this.msg = msg;
    }
}
